package com.project.aiqicha;

import java.io.FileOutputStream;
import java.util.Base64;

import java.util.Base64;
/**
 * desc
 *
 * @author cjq
 * @date 2023-10-17
 */
public class Test2 {
    public static void main(String[] args) throws Exception {


//        String base64Data = "iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAIAAABVOSykAAACDklEQVR42u3YsUsDMRQG8KBTV0Gh\\nCO7FUVSoOgkdLDipf4AVwVGcBFEQwbFLB2elkwgqIm4KYkFwEVGoIDrpoJscjjUQiOEuefeS6yW5\\n2vAtvZZSfv3eXe5Iy+kaz1/wuPoNbwt7yE+S0Ov75gqL/3BbX0uxwXthyEj0UFAs03A1J3B+Voyo\\n3qBexnU7rjZp/Nd5X29ofZ6k91MYmRRuNnfFY/blhbWyKul5ETv/oUrNbA1cToqxVi7icApy16+h\\nWMaam847HsNi7UcMXso+lq6Xg2b17hakUk6wtLyIJwPoEMvrZqmk/gVWz86LNLFSUTjYBYNFqos8\\n0oPicatYKibAS3TZL9UArJCISCPFComINGZY9YczGgnWyOo5SxulolhRFxWWSkrFp5JS8eEXI2Nq\\nMc3qDw55YCmpJiyFx4IbB3cnIZaopjGGIhzm9AQMIIwl5QCwYI52YUHNapzWkQNoLIXEir0axlpk\\nCQu43qWBdVdq0FjFwp/ak2yspMles7pYGljfN2OqSLE2h4NuszTKRb2kZAmxMnA11N2Rxu6z+Dro\\n26DxbZ81WN9O8XbHYAcfJfNqB0+9YDLb94aYrYMP94bL80c0jp864LF8eOrAyLiaCdbnzG0rUyv5\\nCZ6R/WGVHqdY2uU1dFKh6QwsuiqjE5JmcTXYDtkvRsbUnp4/aDKKhRpDrcZ16hiy9QsfDpsKM/Bb\\nRgAAAABJRU5ErkJggg==";
        String base64Data = "iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAIAAABVOSykAAACAklEQVR42u3ZMUgDMRQG4BsERbciVVF0U1wUpJuTUzkRV92dhToJOgjeZkHHLg5dRSsIgqOjHRTFQdxcBCfRXVCfBMI1Mcl7yZ2Xnnf8W3NX+5GXvIvBV3Ghr6AgKLAywgrrh5BCijCzGFle1QaGNuNJrAz/80T7wWqUPy3uHF0fxEe4t2dnXojmi0YWd1XpeObaBiZ8/MxlhYdWhuBFJbPDkpk0ZBommQyJJZCp4BaiCzkdZUjyssDSSwleSCk7LEjrrQRR/br72zmWZFoHKhZGinvhpayx2F2MTAPH1SCJYamGfZz0sqgmERJLs5b9iiWPNxZjik0pEku1Wuk/MkrFyZBYyDF5xiJBdCuWexm6Y9WHI4jxyWfLWxAz1lhtAuK4wCP7BvxuiIEIl8Yd16zX6pEQ1MxiZIKaXUeK77Pw+6DLbphiGcbJ0saiknmH5TKzSH0WSa3ycA6xk3pvNlm8WOBvXo6NL4OkV0XV8u84oTBq2WCRGguMl4zFphvEi5NSR6z+59V4hAHGXsGI5dexMqnPopYh8kWnO7CCxyvSizR+dZexkBuiNVap3Ib4shtmcurgdRkme56Fl3q6rkJyhdUXzbJoyFzOlH3HKv4V9hfX6V6NxfE5YaPNkt6fOtWahngxs7iaIx9Xs+abPFiBqD69295nZH6VYbaTTk8GXt/ud+whXDqEtgAAAABJRU5ErkJggg==";

        byte[] imageBytes = Base64.getDecoder().decode(base64Data);
        try (FileOutputStream fos = new FileOutputStream("image.jpg")) {
            fos.write(imageBytes);
        }
    }
}
